﻿<%@ Page Title="" Language="C#" MasterPageFile="~/DeveloperSite.Master" AutoEventWireup="true" MaintainScrollPositionOnPostback="true"
    CodeBehind="ViewListofIPs.aspx.cs" Inherits="AmkeniCrossLoginApplication.Amkeni_System.CO.ViewListofIPs" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register Assembly="CustomDropDownList" Namespace="CustomDropDownList" TagPrefix="ddl" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
    /*This is used to design the modal popup dialogue box*/
        .modalBackground
            {
                background-color: Black;
                filter: alpha(opacity=90);
                opacity: 0.8;
            }
        .modalPopup
            {
                background-color: #FFFFFF;
                border-width: 3px;
                border-style: solid;
                border-color: black;
                padding-top: 10px;
                padding-left: 10px;
                width: 1200px;
                height: 560px;
            }
    </style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript">
        function uploadComplete(sender) {
            $get("<%=lblMessage.ClientID%>").innerHTML = "File Uploaded Successfully";
        }
        function uploadError(sender) {
            $get("<%=lblMessage.ClientID%>").innerHTML = "File Uploaded Failed";
        }
    </script>

    <asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>

    <div style="height:2em;">
        <div style="float:left;">
            <asp:Label ID="ContextLabel" runat="server" Text="IMPLEMENTING PARTNER METADATA (UPLOADS)" CssClass="ContentHead"></asp:Label>
        </div>
    </div>

    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

    <asp:EntityDataSource ID="IPMetadataDataSource" runat="server" ConnectionString="name=Amkeni_DatabaseEntities"
        DefaultContainerName="Amkeni_DatabaseEntities" EnableDelete="True" EnableFlattening="False"
        EnableInsert="True" EnableUpdate="True" EntitySetName="implementing_partner_metadata"
        EntityTypeFilter="implementing_partner_metadata" Include="implementing_partner,RFP">
    </asp:EntityDataSource>

    <% if (User.IsInRole("Administrator"))
       { %>

    <asp:GridView ID="IPMetadataGridView" runat="server" DataSourceID="IPMetadataDataSource" AutoGenerateColumns="False" 
        DataKeyNames="id,RFP_id,ip_id" CssClass="NewGrid" OnRowCommand="IPMetadataGridView_RowCommand" OnRowDataBound="IPMetadataGridView_RowDataBound">
        <AlternatingRowStyle CssClass="NewGridAlt" />
        <Columns>
            <asp:TemplateField HeaderText="Call" SortExpression="RFP_id">
                <EditItemTemplate>
                    <asp:Label runat="server" Text='<%# Eval("RFP.RFP_name") %>' ID="Label1"></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Eval("RFP.RFP_name") %>' ID="Label1"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Implementing Partner" SortExpression="ip_id">
                <EditItemTemplate>
                    <asp:Label runat="server" Text='<%# Eval("implementing_partner.abbreviation") %>' ID="Label2"></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Eval("implementing_partner.abbreviation") %>' ID="Label2"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Contract" SortExpression="contract">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("contract") %>' ID="TextBox1"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LnkDownloadContract" runat="server" CommandArgument='<%# Eval("id") %>'
                        CommandName="download_contract">Download</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Work Plan" SortExpression="workplan">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("workplan") %>' ID="TextBox2"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LnkDownloadWorkplan" runat="server" CommandArgument='<%# Eval("id") %>'
                        CommandName="download_workplan">Download</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Budget" SortExpression="budget">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("budget") %>' ID="TextBox3"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LnkDownloadBudget" runat="server" CommandArgument='<%# Eval("id") %>'
                        CommandName="download_budget">Download</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Log Frame" SortExpression="logframe">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("logframe") %>' ID="TextBox4"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LnkDownloadLogframe" runat="server" CommandArgument='<%# Eval("id") %>'
                        CommandName="download_logframe">Download</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Registration Certificate" SortExpression="registration_certificate">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("registration_certificate") %>' ID="TextBox5"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LnkDownloadRegCert" runat="server" CommandArgument='<%# Eval("id") %>'
                        CommandName="download_regcert">Download</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="FACE Form" SortExpression="faceform">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("faceform") %>' ID="TextBox6"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LnkDownloadFaceForm" runat="server" CommandArgument='<%# Eval("id") %>'
                        CommandName="download_faceform">Download</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Specimen Signature" SortExpression="specimen_signature">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("specimen_signature") %>' ID="TextBox7"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LnkDownloadSpecSignature" runat="server" CommandArgument='<%# Eval("id") %>'
                        CommandName="download_specimensignature">Download</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Vendor Form" SortExpression="vendor_form">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("vendor_form") %>' ID="TextBox8"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LnkDownloadVendorForm" runat="server" CommandArgument='<%# Eval("id") %>'
                        CommandName="download_vendorform">Download</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID="UploadLinkButton" runat="server" 
                        CommandArgument='<%# Eval("id") %>'
                        OnClick="UploadLinkButton_Click">Upload</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle CssClass="NewGridFooter" />
    </asp:GridView>

    <% } else { %>
        <div style="height:2em;">
        <div style="float:left;">
            <asp:Label ID="Label3" runat="server" Text="YOU CANNOT ACCESS THIS PAGE" CssClass="ContentHead" ForeColor="Red"></asp:Label>
        </div>
    </div>
    <% } %>

</asp:Content>
